package bairui.international.console.web.controller.index.roll;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lianjing.sh.project.commons.util.Util_FileDeal;
import com.lianjing.sh.spring.web.controller.base.action.Action;
import com.lianjing.sh.spring.web.controller.enhance.output.FomatOutput;

import bairui.international.model.domain.jpa.TB_IndexRollImage;
import bairui.international.service.Service_IndexRollImage_Generate;

/**
 *
 * 滚动图片管理
 *
 * @generated
 * 
 * @see STest_C_Index_Roll_RollManage_Delete 测试
 *
 */
@Controller
public class C_Index_Roll_RollManage_Delete
 extends SC_Index_Roll_RollManage_Delete 
{
	
	@Autowired private Service_IndexRollImage_Generate service_IndexRollImage_Generate;

	/**
	 * 删除
	 */
	@Action(Delete.class)
	@DeleteMapping(Delete.RequestMappingValue)
	public @FomatOutput @ResponseBody Object delete(
		@PathVariable(name=Delete.PathVariableName.ImgId) long imgId
	) throws Exception {
		TB_IndexRollImage bean = service_IndexRollImage_Generate.findDeleteById(imgId);
		//
		Util_FileDeal.deleteFile(bean.getFileUrl(), pathConfig.getPosition_Image_IndexRoll());
		return null;
	}
	

}
